from PyQt4.QtGui import QDialog, QDialogButtonBox
from PyQt4.QtGui import QVBoxLayout
from PyQt4.QtGui import QLineEdit

from views.widgets.inputWidget import InputBox


class SignUpView(QDialog):
    def __init__(self, parent=None):
        super(SignUpView, self).__init__(parent)
        self.nameInput = InputBox('username:')
        self.passwordInput = InputBox('password:')
        self.emailInput = InputBox('email:   ')
        self.confirmPasswordInput = InputBox('confirm: ')
        self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        self.passwordInput.edit.setEchoMode(QLineEdit.Password)
        self.confirmPasswordInput.edit.setEchoMode(QLineEdit.Password)
        # Layout
        self.mainLayout = QVBoxLayout()
        self.mainLayout.addLayout(self.nameInput)
        self.mainLayout.addLayout(self.emailInput)
        self.mainLayout.addLayout(self.passwordInput)
        self.mainLayout.addLayout(self.confirmPasswordInput)
        self.mainLayout.addWidget(self.buttonBox)
        self.setLayout(self.mainLayout)

